package com.westcom.secritycheck.bean;

import com.westcom.secritycheck.constants.Constants;
import com.westcom.secritycheck.constants.Constants.*;
import com.westcom.secritycheck.constants.Utils;

import java.util.Random;

public class PassengerFactory
{
    private static Random seed = new Random();
    private static PassengerType[] TYPE_POOL = {PassengerType.normal,PassengerType.pregnancy,PassengerType.handicapped};
    public static Passenger createRandomPassenger()
    {
        Passenger p = new Passenger();
        p.setAge((long) (Constants.MAX_AGE *seed.nextDouble()));
        p.setId(Utils.generateShortUuid());
        p.setType(TYPE_POOL[seed.nextInt(TYPE_POOL.length)]);
        return p;
    }
}
